package com.shengyo.model.service.impl;

import java.util.List;

import com.shengyo.model.bean.Pscore;
import com.shengyo.model.dao.IPscoreDAO;
import com.shengyo.model.service.IPscoreService;

public class PscoreServiceImpl implements IPscoreService{

	private IPscoreDAO pscoreDAO;
	
	
	
	public IPscoreDAO getPscoreDAO() {
		return pscoreDAO;
	}

	public void setPscoreDAO(IPscoreDAO pscoreDAO) {
		this.pscoreDAO = pscoreDAO;
	}

	public PscoreServiceImpl() {
		super();
	}

	public void delete(int id) {
		Pscore pscore = this.findById(id);
		if (pscore != null)
			pscoreDAO.delete(pscore);
	}

	
	@SuppressWarnings("unchecked")
	public List<Pscore> findAll() {
		return pscoreDAO.findAll();
	}

	
	public Pscore findById(int id) {
		return (Pscore) pscoreDAO.findById(id);
	}

	
	public Pscore saveOrUpdate(Pscore pscore) {
		pscore = (Pscore) pscoreDAO.save(pscore);
		return pscore;
	}

}
